><

Applying styles



Styles are applied in three different ways, depending on their selectors. Styles that use tag selectors are applied automatically. Classes require that you select text and apply them manually using the Style tab of the Text Inspector. The Style tab lists all classes in a page's internal or external style sheets.

IDs are a special case because of ambiguities that are still unsolved in the cascading style sheets specification. The current release of Adobe GoLive lets you create IDs, but you have to hand-code in the Source view to use them in your page.

To apply classes:

Do one of the following:

  • To apply an inline style for selected text in a paragraph, in the Style tab of the Text Inspector, select the checkbox in the Inline column for the style you want to apply.
  • To format an entire paragraph with a style, click in the paragraph, and then in the Style tab of the Text Inspector. Select the checkbox in the Par column for the style you want to apply.
  • To create a division that is disconnected from the normal flow of HTML, click in a paragraph and then in Style tab of the Text Inspector. Select the checkbox in the Div column for the style you want to apply.
  • To apply a format to the body section of a page, click anywhere in the document, and then in the Style tab of the Text Inspector. Select the checkbox in the Area column for the style you want to apply.

  • To apply an ID:

    1 Note the name of the desired ID from the Style Sheet window.

    2 In the Source view of the document window, find the paragraph or block of text to which you want to assign the ID, and remove all other formatting to reduce the risk of ambiguity.

    3 If the text to be reformatted is a paragraph, hand-edit the <P> tag by inserting the ID as an attribute in the start tag. For example, if the ID name is #headerbox, edit the code as follows:

    Your original source code looks like this:

    <P>TravelEZ</P>

    After you insert the ID attribute, your source code should look like this:

    <P ID="headerbox">TravelEZ</P>

    4 If the text to be reformatted is a block of text within a paragraph, you will have to enclose that text in a <SPAN> or <DIV> tag and insert the ID as an attribute in the start tag. For example, if the ID name is #headerbox, edit the code as follows:

    Your original source code looks like this:

    <P>Welcome to TravelEZ</P>

    After you insert the <SPAN> tag with the ID attribute, your source code should look like this:

    <P> <SPAN ID="headerbox">Welcome to TravelEZ</SPAN></P>

    5 Switch back to Layout view to view the effect. If you are not satisfied with the result, select the ID style in the Style Sheet window, and edit its properties as desired.


    Using Cascading Style Sheets > Applying styles and referencing style sheets > Applying styles